﻿<Border x:Class="TouchExplorer.Controls.TouchFileDisplayTiles"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <TextBlock HorizontalAlignment="Stretch" Text="{Binding Name}" Style="{StaticResource LargeBlackText}" />
        <Grid Grid.Row="1" Margin="0 8 0 0" HorizontalAlignment="Center">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <Image Source="{Binding BigImage}" />
            <Button Click="Button_Click" Grid.Column="1" Background="Transparent" BorderThickness="0">
                <Image x:Name="ImgElement"  Width="48" Height="48" Stretch="Uniform" />
            </Button>            
        </Grid>
        <Grid Grid.Row="2" Margin="0 8 0 0">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <TextBlock Text="{Binding Info.Extension, Mode=OneTime}" Grid.RowSpan="2" Margin="0 0 5 0" HorizontalAlignment="Center" Foreground="Gray" FontSize="14" FontWeight="Bold" />
            <TextBlock HorizontalAlignment="Stretch" Grid.Column="1" Text="{Binding Info.FullName, Mode=OneTime}" Style="{StaticResource SmallGrayText}" />
            <TextBlock HorizontalAlignment="Stretch" Grid.Row="1" Grid.Column="1" Text="{Binding FileDescription, Mode=OneTime}" Style="{StaticResource SmallGrayText}" />
        </Grid>
    </Grid>
    <Border.Triggers>
        <EventTrigger RoutedEvent="Border.Loaded">
            <BeginStoryboard>
                <Storyboard Name="ItemLoad">
                    <DoubleAnimation   
                            Storyboard.TargetProperty="(Border.Opacity)"   
                            From="0.0" To="1" Duration="0:0:0.3" />
                </Storyboard>
            </BeginStoryboard>
        </EventTrigger>
        <EventTrigger RoutedEvent="Border.Unloaded">
            <BeginStoryboard>
                <Storyboard Name="ItemUnload">
                    <DoubleAnimation   
                            Storyboard.TargetProperty="(Border.Opacity)"   
                            From="1" To="0.0" Duration="0:0:0.3" />
                </Storyboard>
            </BeginStoryboard>
        </EventTrigger>
    </Border.Triggers>
</Border>
